package com.demo.controller;

import com.demo.service.HomeService;
import com.demo.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 首页控制层
 */
@RestController
@RequestMapping("/home")
public class HomeController {
    @Autowired
    private HomeService homeService;

    //返回所有轮播图数据
    @GetMapping("/getAllBanners")
    public Result getAllBanners(){
        return new Result(201,"成功",homeService.findAllBanners());
    }

    //返回所有导航栏数据
    @GetMapping("/getAllGrids")
    public Result findAllGrids(){
        return new Result(201,"成功",homeService.findAllGrids());
    }

    //返回所有漫画模块数据
    @GetMapping("/getAllCarToons")
    public Result getAllCarToons(){
        return new Result(201,"成功",homeService.findAllCarToons());
    }
}
